package com.ms.game.characterInfo;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ms.game.characterInfo.message.CharacterInfoRequest;
import com.ms.game.characterInfo.message.DailyExchangeRequest;
import com.ms.game.invitefriend.message.CGetDownLineListRequest;
import com.ms.player.Player;
import com.ms.service.module.zone.module.BasicZoneModule;
import com.xpec.c4.game.utility.GUID;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.annotations.Name;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.contexts.Contexts;
import com.xpec.c4.service.contexts.ScopeType;

@Name(scopeType = ScopeType.SESSION)
public class CharacterInfoAction extends BaseMessageAction{
	
	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(CharacterInfoAction.class);
	
	//角色基本資料
	@MessageType(typeCode = MessageTypes.C_GET_CHARACTER_INFO_REQUEST)
	public void getCharacterInfo(Object request){ 
		BasicZoneModule module = (BasicZoneModule) Contexts.getModule();
		CharacterInfoProcessor.OnGetCharacterInfo(sessionID , module);
	}
	
	//透過日期查詢遊戲記錄
	@MessageType(typeCode = MessageTypes.C_SEARCH_CHARACTER_GAME_INFO_BY_DATE)
	public void searchCharacterInfoByDate(CharacterInfoRequest request){ 
		BasicZoneModule module = (BasicZoneModule)Contexts.getModule();
		CharacterInfoProcessor.OnSearchCharacterInfoByDate(sessionID , module , request);
	}
	
	// client 要求取得日常收支清單
	@MessageType(typeCode = MessageTypes.C_GET_DAILY_EXCHANGE_REQUEST)
	public void getdailyRevExpInfo(DailyExchangeRequest request) {
		Player player = getPlayer();
		BasicZoneModule module = (BasicZoneModule) Contexts.getModule();
		CharacterInfoProcessor.OnGetDailyExchange(sessionID, module, request);
	}

	// client 要求取得使用了自己邀請碼的下線清單
	@MessageType(typeCode = MessageTypes.C_CHARACTER_INFO_GET_DOWN_LINE_LIST_REQUEST)
	public void onRecvGetDownLineListRequest(CGetDownLineListRequest request) {
		Player player = getPlayer();
		BasicZoneModule module = (BasicZoneModule) Contexts.getModule();
		CharacterInfoProcessor.onRecvGetDownLineListRequest(player, module, request);
	}

	// client 要求取得角色的各等級區間抽佣金額加總清單
	@MessageType(typeCode = MessageTypes.C_CHARACTER_INFO_GET_COMMISSION_DETAIL_REQUEST)
	public void onRecvGetCommissionDetailRequest(String queryPlayerGuid) {
		Player player = getPlayer();
		BasicZoneModule module = (BasicZoneModule) Contexts.getModule();
		CharacterInfoProcessor.onRecvGetCommissionDetailRequest(player, module, GUID.parseUUID(queryPlayerGuid));
	}
}
